Global Index
HTML5 JS API Index > DOM Tutorials & Specs

HTMLOptionElement

Extends HTMLElement.

The option element represents an option in a select element or as part of a list of suggestions in a datalist element.

Properties
boolean
defaultSelected
The disabled IDL attribute must reflect the content attribute of the same name. The defaultSelected IDL attribute must reflect the selected content attribute.
boolean
disabled
The disabled IDL attribute must reflect the content attribute of the same name. The defaultSelected IDL attribute must reflect the selected content attribute.
HTMLFormElement?
form
The form IDL attribute's behavior depends on whether the option element is in a select element or not. If the option has a select element as its parent, or has an optgroup element as its parent and that optgroup element has a select element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that select element.
long
index
The index IDL attribute must return the element's index.
DOMString
label
The label IDL attribute, on getting, must return the element's label. On setting, the element's label content attribute must be set to the new value.
boolean
selected
The selected IDL attribute, on getting, must return true if the element's selectedness is true, and false otherwise. On setting, it must set the element's selectedness to the new value, set its dirtiness to true, and then cause the element to ask for a reset.
DOMString
text
The text IDL attribute, on getting, must return the result of stripping and collapsing whitespace from the concatenation of data of all the Text node descendants of the option element, in tree order, excluding any that are descendants of descendants of the option element that are themselves script elements in the HTML namespace or script elements in the SVG namespace.
DOMString
value
The value IDL attribute, on getting, must return the element's value. On setting, the element's value content attribute must be set to the new value.
Constructor
Option(optional DOMString text, optional DOMString value, optional boolean defaultSelected, optional boolean selected)
Referenced by
HTMLSelectElementsetter creator(...)